SBML Parsing Example


In [ ]:
import means

Biomodels repository hosts a number of published models. We can download one of them to our working directory:


In [ ]:
import urllib
__ = urllib.urlretrieve("http://www.ebi.ac.uk/biomodels/models-main/publ/"
                        "BIOMD0000000010/BIOMD0000000010.xml.origin", 
                        filename="autoreg.xml")

This model can be parsed into MEANS Model object using means.io.read_sbml function. When parsing the SBML format, compartments of species are neglected, as the species names are assumed to be compartment-specific.

The values for the constants and initial amounts of all species are also retrieved for making it easier to simulate the trajectories later.

WARNING: Please note that in order to run this example one will have to have libsmbl installed together with its python bindings.

Consult SBML website for more information on how to do this.


In [ ]:
# Requires: libsbml
autoreg_model, autoreg_parameters, autoreg_initial_conditions \
    = means.io.read_sbml('autoreg.xml')

To view the model, simply output it:


In [ ]:
autoreg_model

Note that a set of parameters and initial conditions are also parsed from the SBML file directly, let's view them:


In [ ]:
print autoreg_parameters[:3], '.. snip ..', autoreg_parameters[-3:]
print autoreg_initial_conditions

You can use autoreg_model like any other Model object.


In [ ]: